package cn.tedu.oop;

public class TestPrivate {
    public static void main(String[] args) {
        Student s=new Student();
//        System.out.println(s.name);
//        System.out.println(s.sno);
//        System.out.println(s.subject);
        s.study();
        s.setSubject("JavaSecurity");
        s.eat();
        System.out.println(s.getSubject());
    }
    
}
class Student{
    private String name;
    private int sno;
    private String subject;

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    /*描述学生行为*/
    public void study(){
        System.out.println("学习java");
    }
    public void eat(){
        System.out.println("拿起了我的饭");
    }
}
